package com.idea.tianmimi;

import android.app.TabActivity;
import android.content.Intent;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.TabHost.TabSpec;

public class BaseTabActivity extends TabActivity
{
	public void addNewTab(int resId, String title,
			Class cls) {

		Button tabIndicator = (Button) LayoutInflater.from(this).inflate(
				R.layout.tabitem_view, getTabHost().getTabWidget(),
				false);
		// Button btn = (Button) tabIndicator.findViewById(R.id.uni_bar_btn);
		tabIndicator.setBackgroundResource(resId);
		tabIndicator.setText(title);
		TabSpec tabSpec = getTabHost().newTabSpec(title)
				.setIndicator(tabIndicator).setContent(new Intent(this, cls));
		getTabHost().addTab(tabSpec);
	}

}
